<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8"/>
		<title>无标题文档</title>
		<link href="css/font-awesome.css" rel="stylesheet">
		<style type="text/css">

		div{width:10px; height:10px; position:absolute; top:0; left:0;}
		div::after{
			font-family: fontawesome;
			content:"\f06c";
			font-size: 18px;
			color:green;
		}
		</style>
		<script type="text/javascript">

		/*
			//使用鼠标的移动事件
			document.onmousemove=function(ev){
				var aDiv=document.getElementsByTagName('div');
				var e=ev||event;
				//遍历所有DIV，从第二个开始到结束
				for(var i=aDiv.length-1;i>0; i--){
					//将第N个的坐标 赋给 第N+1个（即第N+1个跟随第N个）
					aDiv[i].style.top=aDiv[i-1].offsetTop;
					aDiv[i].style.left=aDiv[i-1].offsetLeft;	
				}
				//最后将鼠标位置赋给第一个
				aDiv[0].style.left=e.clientX+'px';
				aDiv[0].style.top=e.clientY+'px';
			}
		*/
		onload = function(){
			var list = document.getElementsByTagName("div");
			//如何将list转换为真数组????
			//var arr = list.slice(0);
			var arr = [];
			for(var i=0; i<list.length; i++){
				arr.push(list[i]);
			}
			
			document.onmousemove = function(evt){
				var e = evt || event;
				var current = arr.pop();
				current.style.left = e.clientX+"px";
				current.style.top = e.clientY+"px";
				arr.unshift(current);
			}
		}
		</script>
	</head>

<body>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
	<div></div>
</body></html>